|
How to send Alerts to E-mail
SMTPAppender publishes the alerts to email specified in the configuration. See the below example.
1. Specify the following
category and
appender in
<Process_Platform_Installation_Directory>/config/Log4jConfiguration.xml and save it.
<category name="com.eibus.management.AlertSystem">
<priority value="info" />
<appender-ref ref="e-mail" />
</category>
<appender class="org.apache.log4j.net.SMTPAppender" name="e-mail">
<param name="SMTPHost" value="srv-ind-dm19jw" />
<param name="To" value="[email protected]" />
<param name="From" value="[email protected]" />
<param name="subject" value="Process Platform Alert"/>
<layout class="org.apache.log4j.HTMLLayout">
<param name="LocationInfo" value="true" />
</layout>
</appender>
2. Perform operations which will raise alerts. Ex: Restart Monitor, sending license report, restart database server etc.
3. Open mail box and check the alerts.
Example of error alert in email

To configure multiple appenders, the corresponding <appender-ref> element should be under <category>. See the following example:
<category name='com.eibus.management.AlertSystem'>
<priority value='info' />
<appender-ref ref='processNamefile' />
<appender-ref ref='e-mail' />
</category>
<appender class='com.eibus.util.logger.appender.ProcessNamedDailyRollingFileAppender' name='processNamefile'>
<param name='File' value='%N.xml' />
<param name='DatePattern' value=".'yyyy-MM-dd" />
<layout class='org.apache.log4j.xml.XMLLayout' />
</appender>
<appender class='org.apache.log4j.net.SMTPAppender' name='e-mail'>
<param name='SMTPHost' value='ADDRESS-OF-SMTP-Host' />
<param name='To' value='DESTINATION@EMAIL' />
<param name='From' value='SENDER@EMAIL' />
<layout class='org.apache.log4j.xml.XMLLayout' />
</appender>
How to send Alerts to Windows Event Log
NTEventLogAppender appender publishes alerts to Windows event log. See the example given below.
1.Specify the following category and appender in <Process_Platform_Installation_Directory>/config/Log4jConfiguration.xml
<category name='com.eibus.management.AlertSystem'>
<priority value='info' />
<appender-ref ref='NTEventLogAppender' />
</category>
<appender xmlns='' class='org.apache.log4j.nt.NTEventLogAppender' name='NTEventLogAppender'>
<layout class='org.apache.log4j.SimpleLayout' />
<param name='source' value='CordysLogger' />
</appender>
2. Perform operations which will raise alerts. Ex: Restart Monitor, sending license report, restart database server etc.
3. Open
Windows Event Viewer and check the alerts.

How to send Alerts to SysLog
SyslogAppender ppender publishes alerts to Windows event log. See the example given below.
1.Specify the following category and appender in <Process_Platform_Installation_Directory>/config/Log4jConfiguration.xml and save it.
<category name='com.eibus.management.AlertSystem'>
<priority value='info' />
<appender-ref ref='SyslogAppender' />
</category>
<appender xmlns='' class='org.apache.log4j.net.SyslogAppender' name='SyslogAppender'>
<param name='syslogHost' value='<machinename>' />
<param name='Facility' value='local6' />
<layout class='org.apache.log4j.SimpleLayout' />
</appender>
2. Perform operations which will raise alerts. For example: restarting monitor, sending license report, restart database server and so on.
3. Open SysLog and check alerts.
Example of log messages in SysLog

How to send Alerts to File System
File appender is the default consumer type built into the alert system. By default, this appender writes alerts to the log file at <Process_Platform_Installation_Directory>\<instance>\Logs.
- ProcessNamedDaily RollingFileAppender* - This appender creates a daily rolling file for each process. This is the default consumer supported by the Alert System.
<category name='com.eibus.management.AlertSystem'>
<priority value='info' />
<appender-ref ref='processNamefile'/>
</category>
<appender class='com.eibus.util.logger.appender.ProcessNamedDailyRollingFileAppender' name='processNamefile'>
<param name='File' value='%N.xml' />
<param name='DatePattern' value="'.'yyyy-MM-dd" />
<layout class='org.apache.log4j.xml.XMLLayout' />
</appender>
Note: The naming convention for pattern would be '%N.xml'. A file is created for each process with the name as process name, located at <Process_Platform_Installation_Directory>\Logs folder. This file contains both the alert as well as log messages. If required, the alert messages can be published to a different file. The sample configuration would then be as follows:
<category name='com.eibus.management.AlertSystem' additivity='false'>
<priority value='info' />
<appender-ref ref='alertfile' />
</category>
<appender class='com.eibus.util.logger.appender.ProcessNamedDailyRollingFileAppender' name='alertfile'>
<param name='File' value='Alert%N.xml' />
<param name='DatePattern' value="'.'yyyy-MM-dd" />
<layout class='org.apache.log4j.xml.XMLLayout' />
</appender>